/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package helpers;

import constants.Consts;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

/**
 *
 * @author Bari
 */
public class JsonHelper {
    
    
   public static String createErrorResponseJson(String erroMsg)  {
        try {
            JSONObject errorJson = new JSONObject();
            errorJson.putOpt(Consts.JSON_ERROR, erroMsg);
            return errorJson.toString();
        } catch (JSONException ex) {
            Logger.getLogger(JsonHelper.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
   
    
}
